package ru.urfc.portal.model.accounting;

import java.util.Date;

import javax.persistence.Entity;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

import ru.urfc.portal.model.TmpContragent;
import ru.urfc.portal.ui.client.Constants;

@Table(name = "portal_contragents")
@Entity
@XmlRootElement(name = Constants.CONTRAGENT)
public class Contragent extends ContragentUpdate {
	private String name;
	public String judicialZip;
	public String judicialCity;
	public String judicialAddress;
	private String inn;
	public String kpp;
	private String ogrn;
	@Temporal(TemporalType.DATE)
	public Date rfcRegistrationDate;
	public String head;
	public String bankName;
	public String bankCity;
	public String bankAddress;
	public String bankOperatingAccount;
	public String bankCorrespontentAccount;
	public String bik;
	public String hozForm;
	
	public Contragent() {
	}

	public Contragent(String name) {
		this.name = name;
	}
	
	
	public Contragent(Long id) {
		super(id);
	}

	public Contragent(Long id, String phone, String fax, String email, String postalZip,
			String postalCity, String postalAddress, String name,
			String judicialZip, String judicialCity, String judicialAddress,
			String inn, String kpp, String ogrn, Date rfcRegistrationDate,
			String head, String bankName, String bankCity, String bankAddress,
			String bankOperatingAccount, String bankCorrespontentAccount, String bik,
			String hozForm) {
		super(id, phone, fax, email, postalZip, postalCity, postalAddress);
		this.name = name;
		this.judicialZip = judicialZip;
		this.judicialCity = judicialCity;
		this.judicialAddress = judicialAddress;
		this.inn = inn;
		this.kpp = kpp;
		this.ogrn = ogrn;
		this.rfcRegistrationDate = rfcRegistrationDate;
		this.head = head;
		this.bankName = bankName;
		this.bankCity = bankCity;
		this.bankAddress = bankAddress;
		this.bankOperatingAccount = bankOperatingAccount;
		this.bankCorrespontentAccount = bankCorrespontentAccount;
		this.bik = bik;
		this.hozForm = hozForm;
	}
	
	public Contragent(TmpContragent tmp) {
		this.name = tmp.getName();
		this.inn = tmp.getInn();
		this.ogrn = tmp.getOgrn();
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getInn() {
		return inn;
	}

	public void setInn(String inn) {
		this.inn = inn;
	}

	public String getOgrn() {
		return ogrn;
	}

	public void setOgrn(String ogrn) {
		this.ogrn = ogrn;
	}

}
